﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace IMeiWeiWebService.Providers
{
    public class IdFactoryProvider
    {
        IMeiWei.BLL.idfactory bll_idFactory = new IMeiWei.BLL.idfactory();

        public string GetNewBusinessId(string idType)
        {
            var model = bll_idFactory.GetModelList(" IdType = '" + idType + "'").FirstOrDefault();

            string newBusinessId = model.CurrentBusinessId.ToString();

            model.CurrentBusinessId++;

            bll_idFactory.Update(model);

            return newBusinessId;
        }

    }
}